package com.CST.service.impl.cb;

import com.CST.entity.cb.CostDataInfo;
import com.CST.mapper.cst.cb.CostDataMapper;
import com.CST.service.cb.ICostDataService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author ly
 * @since 2022-01-24
 */
@Service
public class CostDataServiceImpl extends ServiceImpl<CostDataMapper, CostDataInfo> implements ICostDataService  {
    @Override
    public List<CostDataInfo> getCostDataSource(CostDataInfo entity) {
        List<CostDataInfo> lst = new ArrayList<>();
        try {
            //取查询时间的年
            entity.setSalaryTableName("ETL_SALARY_" + entity.getYear());
            entity.setAccvouchTableName("ETL_Accvouch_" + entity.getYear());
            //取查询月的字段
            entity.setFiled("dblDepr" + entity.getMonth());


            lst = baseMapper.getCostDataSource(entity);
        }
        catch (Exception ex)
        {
            int a =0;
        }
        return lst;
    }
}
